<?php

namespace app\company\model;

/**
 * 分拣(商品)
 * @property  int $id
 * @property  int $company_id 公司id
 * @property  int $print_time  打印时间
 * @property  int $dow_time  下载时间
 * @property  int $dow_count  下载次数
 * @property  int $print_count  打印次数
 *
 */
class PickingGoods extends Base
{
    public static function onBeforeUpdate(PickingGoods $model): void
    {
        if (request()->param('is_dow', 0)) {
            $model->dow_time  = time();
            $model->dow_count = $model->dow_count + 1;
        }
        if (request()->param('is_print', 0)) {
            $model->print_time  = time();
            $model->print_count = $model->print_count + 1;
        }
    }
}